using System;
using MvcMall.AdminPortal.Controllers.MailTemplate.ViewModels;
using MvcMall.Framework.Mapper;

namespace MvcMall.AdminPortal.Controllers.MailTemplate.Mappers
{
    public class DomainToSaveModelMapper :
        BaseMapper<Core.Domains.MailTemplate, SaveMailTemplateModel>
        , IMapper<Core.Domains.MailTemplate, SaveMailTemplateModel>
    {
        public override SaveMailTemplateModel MapFrom(Core.Domains.MailTemplate input)
        {
            var model = new SaveMailTemplateModel
                           {
                               Id = input.Id,
                               MailTemplateType = Convert.ToInt32(input.MailTemplateType),
                               Title = input.Title,
                               MailTemplateName = input.TemplateName,
                               MailBody = input.MailBody
                           };
            return model;
        }
    }
}